package com.bjpowernode.controller.advice;
import com.bjpowernode.dto.ResultDTO;
import com.bjpowernode.exception.MyException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@RestControllerAdvice
public class MyExceptionAdviceController {


    @ExceptionHandler(MyException.class)
    public ResultDTO myException(MyException e){
        ResultDTO resultDTO=new ResultDTO();
        resultDTO.setResult(false);
        resultDTO.setMess(e.getMessage());
        return resultDTO;
    }





}
